package com.emser.unc.client.event;

import com.emser.unc.client.service.ProductServiceAsync;
import com.emser.unc.serializable.ProductDTO;
import com.google.gwt.event.shared.GwtEvent;

public class EditProductEvent extends GwtEvent<EditProductEventHandler> {
public static Type<EditProductEventHandler> TYPE = new Type<EditProductEventHandler>();
	private ProductDTO product;
	private ProductServiceAsync productServiceAsync;
	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<EditProductEventHandler> getAssociatedType() {
		return TYPE;
	}
	public EditProductEvent(ProductDTO product,ProductServiceAsync productServiceAsync) {
	    this.product = product;
	    this.productServiceAsync =productServiceAsync;
	  }
	
	@Override
	protected void dispatch(EditProductEventHandler handler) {
		handler.onEdit(this);
		
	}
	public EditProductEvent(ProductDTO product) {
	    this.product = product;
	  }

	  public ProductDTO getProduct() {
	    return product;
	  }
	  public ProductServiceAsync getRPCserviceProduct(){
			return productServiceAsync;	
		}
}
